<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>工单查询</title>
</head>
<body>
    <div th:fragment="main" id="workOrder" class="workOrder">
        <link rel="stylesheet" th:href="@{/assets/jqGrid/css/jqgridReset.css}">
        <link rel="stylesheet" th:href="@{/css/workOrderMaintenance/workOrder.css}">
        <div class="workOrder_content">
            <div class="title">
                <ol class="breadcrumb title-content">
                    <li><a href="#qualitycontrol-workOrderMaintenance-workOrder">任务管理</a></li>
                    <li>工单查询</li>
                </ol>
            </div>
            <!-- 表单组 -->
            <div class="queryForm">
                <form action="" class="query_form" id="query_form">
                    <div class="queryTable">
                        <table>
                            <tbody>
                            <tr>
                                <td class="condition_title">
                                    <span>产品线</span><i>&nbsp;:</i>
                                </td>
                                <td class="condition_content">
                                    <select name="productLineId" class="form-control" id="productLineId">
                                        <!-- 产品线 -->
                                    </select>
                                </td>
                                <td class="condition_title">
                                    <span>项目名称</span><i>&nbsp;:</i>
                                </td>
                                <td class="condition_content">
                                    <input name="projectName" type="text" class="form-control" id="projectName" placeholder="请输入项目名称">
                                </td>
                                <td class="condition_title">
                                    <span>施工单位</span><i>&nbsp;:</i>
                                </td>
                                <td class="condition_content">
                                    <input name="constructionTeamName" type="text" class="form-control" id="constructionTeamName" placeholder="请输入施工单位名称">
                                </td>
                                <td class="condition_button" rowspan="2">
                                    <div class="condition_buttons clearfix">
                                        <input id="fileupload" name="fileupload" type="file" style="display: none;" data-url="workorder/importWorkOrder">
                                        <input type="button" value="导入" class="btn import" onclick="$('#fileupload').click();" id="import" th:if="${#authorization.expression('hasAuthority(''importWorkOrder'')')}">
                                        <input type="button" value="导出" class="btn export" id="export">
                                        <input type="button" value="查询" class="btn query" id="query">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="condition_title">
                                    <span>设备编号</span><i>&nbsp;:</i>
                                </td>
                                <td class="condition_content">
                                    <input name="deviceId" type="text" class="form-control" id="deviceName" placeholder="请输入设备编号">
                                </td>
                                <td class="condition_title">
                                    <span>设备类型</span><i>&nbsp;:</i>
                                </td>
                                <td class="condition_content">
                                    <select name="deviceTypeId" class="form-control" id="deviceTypeId">
                                        <!-- 设备类型 -->
                                    </select>
                                </td>
                                <td class="condition_title">
                                    <span>状态</span><i>&nbsp;:</i>
                                </td>
                                <td class="condition_content">
                                    <select class="form-control" name="authType" id="workOrderState">
                                        <option value="" selected>选择状态</option>
                                        <option value="0">未分派</option>
                                        <option value="1">进行中</option>
                                        <option value="2">完成</option>
                                    </select>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    </div>
                </form>
            </div>
            <!-- 数据表格 -->
            <div class="workOrder-table" id="workOrder-table">
                <table id="workOrderList"></table>
                <div id="gridpager"></div>
            </div>
        </div>
        <script th:src="@{/js/workOrderMaintenance/workOrder.js}"></script>
        <script th:src="@{/assets/jquerUi/jquery.ui.widget.js}"></script>
        <script th:src="@{/assets/jquerUi/jquery.fileupload.js}"></script>
        <script>
            $(document).ready(function(){
                pageInit();
            });

            // 导入
            $('#fileupload').fileupload({
                dataType: 'json',
                done: function (e, data) {
                    if(data.result.code == "1") {
                        toastr.success('导入工单成功！');
                    } else if(data.result.code == "2") {
                        toastr.error(data.result.message,'操作失败');
                    } else {
                        toastr.error(data.result.message,'导入工单部分成功！');
                    }
                   $("#workOrderList").jqGrid().trigger('reloadGrid');
                }
            });
        </script>
    </div>
</body>
</html>